<?php $this->load->view('_inc/header_popup'); ?>
<script>
    google.load('visualization', '1.0', {'packages':['corechart']});
    google.setOnLoadCallback(drawChart);
    function drawChart() {
        var presente = <?php echo $estatistica->presente?>;
        var cedo = <?php echo $estatistica->cedo?>;
        var atrasado = <?php echo $estatistica->atrasado?>;
        var falta = <?php echo $estatistica->falta?>;
        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Situações');
        data.addColumn('number', 'Número');
        data.addRows([
          ['Presente', presente],
          ['Saiu mais cedo', cedo],
          ['Atrasado', atraso],
          ['Falta', falta],
        ]);
        
        // Set chart options
        var options = {
            'width':645,
            'height':300,
            'colors': ['#29ff49', '#37e8df', '#d9f53b', '#ff6347'],
            'backgroundColor': 'transparent',
            'is3D': true 
        };

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('graf1'));
        chart.draw(data, options);
      }
</script>

<div id='graf'></div>